package edu.gatech.coc.sirana.parser;

import java.util.ArrayList;

import net.util.Debug;

public class OneWebPageInteractionLogParser {
/**
 * Encapsulate client log items of one Web page. 
 */
	private ArrayList<ClientLogItem> interactions = new ArrayList<ClientLogItem>();
	
	public OneWebPageInteractionLogParser(ArrayList<String> logItemStrings){
//		Debug.println("==Build onePageInteractionLogParser from: ");
//		Debug.printlnStringCollection(logItemStrings);
		
		ArrayList<ClientLogItem> _interaction = new ArrayList<ClientLogItem>();
		for (String logItemS : logItemStrings){
			ClientLogItem clip	= new ClientLogItem(logItemS);
			_interaction.add(clip);
		}
		
		this.setInteractions(_interaction);
	}

	public ArrayList<ClientLogItem> getInteractions() {
		return interactions;
	}

	public void setInteractions(ArrayList<ClientLogItem> interactions) {
		this.interactions = interactions;
	}
	
	public String toString(){
		StringBuffer sb	= new StringBuffer();
		
		for (ClientLogItem _interact : this.interactions)
			sb.append(_interact.toString() );
		
		sb.append("\n");
		return sb.toString();
	}
}
